<template>
  <div>
    <el-dialog
      v-model="showFormVisible"
      :title="title"
      width="500"
      center
    >
      <el-form :model="showForm" label-width="120px">
        <el-form-item
          v-for="item in showConfig"
          :key="item.fieId"
          :label="item.label"
        >
          <el-input :disabled="true" v-model="showForm[item.fieId]" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="showFormVisible = false">
            取消
          </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref, onMounted, toRefs, defineProps } from "vue";

const props = defineProps({
  showConfig: Object,
  title: String,
});
const showForm = ref({});
const showFormVisible = ref(false);
const handleShow = (row: any) => {
  let handleRow = JSON.parse(JSON.stringify(row));
  showFormVisible.value = true;
  showForm.value = handleRow;
};
defineExpose({ handleShow });

</script>

<style lang="less" scoped></style>
